package com.wk.springcloud.user.server.nosql.feign;

import com.wk.springcloud.user.feign.interfaces.IFeignUser;
import com.wk.springcloud.user.feign.qo.UserQO;
import com.wk.springcloud.user.feign.vo.UserVO;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RefreshScope //支持动态刷新
public class FeignUserController implements IFeignUser {

    @Value("${config.name:没有找到配置项}")
    private String configName;

    @Override
    public int save(@RequestBody UserQO qo) {
        return 0;
    }

    @Override
    public int deleteById(@PathVariable(value = "id") Long id) {
        return 0;
    }

    @Override
    public int updateById(@RequestBody UserQO qo) {
        return 0;
    }

    @Override
    public UserVO getById(@PathVariable(value = "id") Long id) {
        return null;
    }

    @Override
    public String hello() {
        StringBuffer stringBuffer = new StringBuffer();
        stringBuffer.append("配置中心：").append("\t").append(configName);
        stringBuffer.append("<br/>");
        stringBuffer.append("user-server-nosql8082 , say 【hello】 to you !!!");
        return stringBuffer.toString();
    }

}
